#include <iostream>
using namespace std;

// 编写一个程序，要求输入N个学生数据，，包括学号、姓名、成绩，输出这些学生数据并计算平均分。

class Student
{
public:
    Student(string id, string name, int age, int score) : id(id), name(name), age(age), score(score)
    {
    }

    // void show(Student &s1, Student &s2, Student &s3, Student &s4)
    // {
    //     cout << "学号\t姓名\t年龄\t成绩" << endl;
    //     cout << id << "\t" << name << "\t" << age << "\t" << score << endl;
    //     cout << s1.id << "\t" << s1.name << "\t" << s1.age << "\t" << s1.score << endl;
    //     cout << s2.id << "\t" << s2.name << "\t" << s2.age << "\t" << s2.score << endl;
    //     cout << s3.id << "\t" << s3.name << "\t" << s3.age << "\t" << s3.score << endl;
    //     cout << s4.id << "\t" << s4.name << "\t" << s4.age << "\t" << s4.score << endl;
    // }

    void getAverage(Student &s1, Student &s2, Student &s3, Student &s4)
    {
        int sum = score + s1.score + s2.score + s3.score + s4.score;
        cout << "平均分：" << sum / 5 << endl;
    }

    void show(const Student (&s)[5])
    {
        int len = sizeof(s) / sizeof(s[0]);
        cout << "学号\t姓名\t年龄\t成绩" << endl;
        for (int i = 0; i < len; i++)
        {
            cout << s[i].id << "\t" << s[i].name << "\t" << s[i].age << "\t" << s[i].score << endl;
        }
    }

private:
    string id;
    string name;
    int age;
    int score;
};

int main()
{
    Student s[5] = {Student("001", "张三", 18, 90), Student("002", "李四", 19, 80), Student("003", "王五", 20, 70), Student("004", "赵六", 21, 60), Student("005", "钱七", 22, 50)};
    // Student s1("001", "张三", 18, 90);
    // Student s2("002", "李四", 19, 80);
    // Student s3("003", "王五", 20, 70);
    // Student s4("004", "赵六", 21, 60);
    // Student s5("005", "钱七", 22, 50);

    // s1.show(s2, s3, s4, s5);
    s->show(s);
    // s1.getAverage(s2, s3, s4, s5);
}